@extends('admin.layout.common')
@section('content')
    <link rel="stylesheet" type="text/css" href="{{asset('/css/storage/password.css')}}">
    <link rel="stylesheet" href="{{asset('/css/app.css')}}">
    <div class="content" style="margin:100px auto;">
        <form id="signupForm" action="{{url('/admin/changepass')}}" method="post">
            @include('flash::message')
            {{csrf_field()}}
                <div>
                    <span>请输入原始密码：</span>
                    <input type="password" name="old_login_password">
                </div>
                <div>
                    <span>请输入新的密码：</span>
                    <input id="login_password" type="password" name="login_password">
                </div>
                <div>
                    <span>确认新的密码：&nbsp;&nbsp;&nbsp;</span>
                    <input id="re_login_password" type="password" name="re_login_password">
                </div>
                <button class="affirm_btn">确认修改</button>
            </form>
        </div>
    <script type="text/javascript" src="{{asset('/js/storage/password.js')}}"></script>
    <script>
      $().ready(function() {
// 在键盘按下并释放及提交后验证提交表单
        $("#signupForm").validate({
          rules: {
            old_login_password: {
              required: true
            },
            login_password: {
              required: true,
              minlength: 8
            },
            re_login_password: {
              required: true,
              minlength: 8,
              equalTo: "#login_password"
            }
          },
          messages: {
            old_login_password: {
              required: "请输入原密码"
            },
            login_password: {
              required: "请输入密码",
              minlength: "密码长度不能小于 8 个字母"
            },
            re_login_password: {
              required: "请输入密码",
              minlength: "密码长度不能小于 8 个字母",
              equalTo: "两次密码输入不一致"
            }
          }
        })
      });
    </script>
@endsection